﻿#pragma once
#ifndef __CONFIG_H__
#define __CONFIG_H__

#include <Windows.h>

#define CONSOLE_WIDTH  110   //控制台横向长度
#define CONSOLE_HEIGHT 38 //控制台纵向高度▏

#define MAP_WIDTH  35       //地图横向宽度
#define MAP_HEIGHT 35       //地图纵向高度

#define STATUS_WIDTH 15             //  状态栏宽度
#define STATUS_HEIGHT MAP_HEIGHT    //  状态栏宽度

#define MAX_STRING_LEN 100      //字符串最大字节数

//物品图形▓ ▒ ▓〓※◆★
#define ITEM_MAX_BYTES 4

#define NOTHING "  "
#define WALL "■"
#define BRICK_L1 "〓" 
#define BRICK_L2 "■"
#define BRICK_L3 "※"
#define BRICK_L4 "◆"
#define BRICK_L5 "▓"
 
#define TANK "■"
#define BULLET "●"

#define TARGET "★"
#define STAR   "★"

//物品ID
#define WALL_ID     0xff
#define NOTHING_ID  0x00
#define BRICK_L1_ID 0x01    //〓
#define BRICK_L2_ID 0x02    //■
#define BRICK_L3_ID 0x03    //※
#define BRICK_L4_ID 0x04    //◆
#define BRICK_L5_ID 0x05    //▓

#define BULLET_ID   0x09    //

//星星ID
#define STAR_ID     0x1f    // ★
#define STAR_POS_X (MAP_WIDTH / 2)
#define STAR_POS_Y (MAP_HEIGHT - 3)

//目标ID
#define TARGET_ID   0x7f    // ★
#define TARGET_POS_X (MAP_WIDTH / 2)
#define TARGET_POS_Y 2

//物品颜色
#define WALL_COLOR  FOREGROUND_BLUE
#define BRICK_L1_COLOR  FOREGROUND_RED | FOREGROUND_GREEN
#define BRICK_L2_COLOR  FOREGROUND_BLUE | FOREGROUND_INTENSITY
#define BRICK_L3_COLOR  FOREGROUND_GREEN
#define BRICK_L4_COLOR  FOREGROUND_RED | FOREGROUND_BLUE
#define BRICK_L5_COLOR  FOREGROUND_GREEN | FOREGROUND_RED
#define STAR_COLOR      FOREGROUND_RED 
#define TARGET_COLOR      FOREGROUND_RED

#define BULLET_COLOR  FOREGROUND_GREEN

typedef unsigned char ID;
ID map[MAP_WIDTH][MAP_HEIGHT];  //地图数组

//坦克颜色 
//用法：TANK_COLOR[tank.type>>4]
int TANK_COLOR[] = {   0,  //占位符
                      (FOREGROUND_RED | FOREGROUND_BLUE),    /*PLAYER颜色*/
                      (FOREGROUND_RED | FOREGROUND_GREEN),  /*AI1颜色*/ 
                      (FOREGROUND_BLUE | FOREGROUND_GREEN),  /*AI2颜色*/ 
                      (FOREGROUND_RED),  /*AI3颜色*/ };
//贴图数组
typedef struct _Mapping {
    char mapping[ITEM_MAX_BYTES];
    int color;
}Mapping;
Mapping MAPPING_ARRAY[] = { { NOTHING, 0},
                               { BRICK_L1, BRICK_L1_COLOR},
                               { BRICK_L2, BRICK_L2_COLOR},
                               { BRICK_L3, BRICK_L3_COLOR},
                               { BRICK_L4, BRICK_L4_COLOR},
                               { BRICK_L5, BRICK_L5_COLOR} };

#endif // !__CONFIG_H__
